﻿<Grid x:Class="LFSRecord2.View.TimelineStructures.AudioRegionControl"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:lfsconv="clr-namespace:LFSRecord2.View.Converters"
      mc:Ignorable="d" 
      d:DesignHeight="17" d:DesignWidth="300"
      Height="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ItemsControl}}, Path=ActualHeight}"
      Loaded="Grid_Loaded"
      ClipToBounds="True">
    <Grid.Resources>
        <lfsconv:AudioRegionSelectedForegroundBrushConverter x:Key="audioRegionSelectedForegroundBrushConverter" />
        <lfsconv:AudioRegionSelectedBackgroundBrushConverter x:Key="audioRegionSelectedBackgroundBrushConverter" />
    </Grid.Resources>
    <Border CornerRadius="4,1,1,1" BorderThickness="1" BorderBrush="#90202020" Background="#FFF4F4F4">
        <Grid Name="ContentGrid">
            <Grid Background="{Binding IsSelected, Converter={StaticResource audioRegionSelectedBackgroundBrushConverter}}"
                    Margin="1,1,1,1">
                <Image Name="WaveViewPath" 
                      Margin="-1, 0, 0, 0"
                      Visibility="Collapsed" 
                      IsHitTestVisible="False"
                       Stretch="None"
                       HorizontalAlignment="Left">
                </Image>
            </Grid>
            <TextBlock Name="AudioName" 
                       Margin="4,0,0,0" 
                       VerticalAlignment="Top" 
                       FontSize="10" 
                       Foreground="{Binding IsSelected, Converter={StaticResource audioRegionSelectedForegroundBrushConverter}}" 
                       IsHitTestVisible="False" />
        </Grid>
    </Border>
</Grid>
